﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace K3R.Web.Interface {
	[DataContract]
	public class LogID : IComparable<LogID> {
		[DataMember(Name = "code")] public string Code { get; set; }
		[DataMember(Name = "id")] public int ID { get; set; }

		public LogID() { }

		public override string ToString() {
			return String.Format("[{0}, {1}]", Code, ID);
		}

		#region IComparable<LogID> Members
		public int CompareTo(LogID other) {
			var compare = this.Code.CompareTo(other.Code);
			if (compare == 0)
				compare = this.ID.CompareTo(other.ID);

			return compare;
		}
		#endregion
	}
}
